﻿using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace slwhTools.FileHelper
{
    public interface ISFileFactory
    {
        /// <summary>
        /// 保存文件流
        /// </summary>
        /// <param name="stream"></param>
        public Task<string> SaveFileStreamAsync(MemoryStream stream, string originalFileName, long fileSize, string filename = "");

        /// <summary>
        /// 保存文件流
        /// </summary>
        /// <param name="stream"></param>
        public string SaveFileStream(MemoryStream stream, string originalFileName, long fileSize, string filename = "");

        /// <summary>
        /// 保存文件
        /// </summary>
        /// <param name="stream"></param>
        public string SaveFile(IFormFile file, string filename = "");

        /// <summary>
        /// 保存文件
        /// </summary>
        /// <param name="stream"></param>
        public Task<string> SaveFileAsync(IFormFile file, string filename = "");

        /// <summary>
        /// 保存文件,不进行文件验证
        /// </summary>
        /// <param name="stream"></param>
        public Task<string> NoValidSaveFileAsync(MemoryStream stream, string filename = "");
        /// <summary>
        /// 保存文件,不进行文件验证
        /// </summary>
        /// <param name="stream"></param>
        public string NoValidSaveFile(MemoryStream stream, string filename = "");


        Task<string> ReadStaticFileAsync(string relativePath);
        Task<string> ReadLocalFileAsync(string fullPath);
        Task<byte[]> ReadStaticFileAsBytesAsync(string relativePath);
        Task<byte[]> ReadLocalFileAsBytesAsync(string fullPath);
        Task<bool> FileExistsAsync(string path);
    }
}
